package kuzha.ast;

public class ForStatement extends BlockStatement {
	public final String name;
	public final Expression value;
	public final Statement body, _else;
	
	public ForStatement(String name, Expression value, Statement body, Statement _else) {
		if (name == null || value == null || body == null)
			throw new IllegalArgumentException();
		this.name = name;
		this.value = value;
		this.body = body;
		this._else = _else;
	}
	
	@Override
	public void accept(AstVisitor visitor) {
		visitor.visit(this);
	}
	@Override
	public <A, R> R accept(AstVisitor2<A, R> visitor, A object) {
		return visitor.visit(this, object);
	}
}
